﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="UIXMLSchema"
    targetNamespace="http://Schema.DirectUI.com.cn/MobileUI.xsd"
    elementFormDefault="qualified"
    xmlns="http://Schema.DirectUI.com.cn/MobileUI.xsd"
    xmlns:mstns="http://Schema.DirectUI.com.cn/MobileUI.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
  <xs:attributeGroup name="coordinates">
    <xs:attributeGroup ref="location"/>
    <xs:attributeGroup ref="size"/>
    <xs:attribute name="constraint" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation>
          The constraints of the LayoutMgr e.g. NORTH, CENTER, or 14
          comma-separated grid-bag constraints
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="layoutStyle">
      <xs:annotation>
        <xs:documentation>The Layout Style for BoxLayout</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:NMTOKEN">
          <xs:enumeration value="0"/>
          <xs:enumeration value="1"/>
          <xs:enumeration value="X"/>
          <xs:enumeration value="Y"/>
          <xs:enumeration value="LINE"/>
          <xs:enumeration value="PAGE"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:attributeGroup name="location">
    <xs:attribute name="x" type="xs:integer" use="optional"/>
    <xs:attribute name="y" type="xs:integer" use="optional"/>
  </xs:attributeGroup>
  <xs:attributeGroup name="size">
    <xs:attribute name="w" type="xs:nonNegativeInteger" use="optional"/>
    <xs:attribute name="h" type="xs:nonNegativeInteger" use="optional"/>
  </xs:attributeGroup>
  <xs:attributeGroup name="event">
    <xs:attribute name="OnClick" type="xs:string" use="optional"></xs:attribute>
    <xs:attribute name="OnGotFocus" type="xs:string" use="optional"></xs:attribute>
    <xs:attribute name="OnInitialize" type="xs:string" use="optional"></xs:attribute>
    <xs:attribute name="OnForeColorChanged" type="xs:string" use="optional"></xs:attribute>
    <xs:attribute name="OnKeyDown" type="xs:string" use="optional"></xs:attribute>
    <xs:attribute name="OnKeyPress" type="xs:string" use="optional"></xs:attribute>
    <xs:attribute name="OnKeyUp" type="xs:string" use="optional"></xs:attribute>
    <xs:attribute name="OnLostFocus" type="xs:string" use="optional"></xs:attribute>
    <xs:attribute name="OnPaintBackground" type="xs:string" use="optional"></xs:attribute>
    <xs:attribute name="OnParentChanged" type="xs:string" use="optional"></xs:attribute>
    <xs:attribute name="OnSizeChanged" type="xs:string" use="optional"></xs:attribute>
    <xs:attribute name="OnVisbleChanged" type="xs:string" use="optional"></xs:attribute>

  </xs:attributeGroup>
  <xs:complexType name="Component">
    <xs:attribute name="name" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation>
          The name of the component. Must be specified if references to this
          element are needed
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="style" type="xs:string" use="optional"/>
    <xs:attribute name="fontStyle" type="xs:string" use="optional"/>
    <xs:attribute name="fontSize" type="xs:float" use="optional"/>
    <xs:attribute name="Alpha" type="xs:int" use="optional">
      <xs:annotation>
        <xs:documentation>
          the Alpha value specifies the transparency of the panel between 0 (transparent) and 255 (opaque).
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>

    <xs:attribute name="tooltip" type="xs:string" use="optional"/>
    <xs:attribute name="backColor" type="xs:string" use="optional"/>
    <xs:attribute name="foreColor" type="xs:string" use="optional"/>
    <xs:attribute name="visible" type="xs:boolean" use="optional"/>
    <xs:attribute name="enabled" type="xs:boolean" use="optional"/>
    <xs:attributeGroup ref="coordinates"/>
    <xs:attributeGroup ref="event"></xs:attributeGroup>
    <xs:attribute name="minimumsize" use="optional">
      <xs:annotation>
        <xs:documentation>
          Specify width and height in pixels separated by a comma
          (,)
        </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value=".+,.+"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="maximumsize" use="optional">
      <xs:annotation>
        <xs:documentation>
          Specify width and height in pixels separated by a comma
          (,)
        </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value=".+,.+"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute ref="alignment"/>
    <xs:attribute ref="border"/>
  </xs:complexType>
  <xs:attribute name="border">
    <xs:annotation>
      <xs:documentation>Specifies whether the border should be drawn or not</xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:enumeration value="none">
          <xs:annotation>
            <xs:documentation>No Border</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="empty">
          <xs:annotation>
            <xs:documentation>
              Empty Border filled with
              color_back
            </xs:documentation>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="line">
          <xs:annotation>
            <xs:documentation>Line Border</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="thinline">
          <xs:annotation>
            <xs:documentation>Line Border</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="thickline">
          <xs:annotation>
            <xs:documentation>Line Border</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="rounded">
          <xs:annotation>
            <xs:documentation>Rounded Border</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="bevel">
          <xs:annotation>
            <xs:documentation>Rounded Border</xs:documentation>
          </xs:annotation>
        </xs:enumeration>
      </xs:restriction>
    </xs:simpleType>
  </xs:attribute>
  <xs:attribute name="alignment">
    <xs:simpleType>
      <xs:restriction base="xs:NMTOKEN">
        <xs:enumeration value="left"/>
        <xs:enumeration value="right"/>
        <xs:enumeration value="center"/>
        <xs:enumeration value="Left"/>
        <xs:enumeration value="Right"/>
        <xs:enumeration value="Center"/>
        <xs:enumeration value="Leading"/>
        <xs:enumeration value="Trailing"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:attribute>
  <xs:element name="Label">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="Component">
          <xs:attribute name="shadowColor" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="content" type="xs:string" use="optional">
            <xs:annotation>
              <xs:documentation>
                The content of the element. In most cases this is the text which
                should be displayed
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="PictureBox">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="Component">
          <xs:attribute name="src" type="xs:string" use="required"></xs:attribute>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="Components">
    <xs:complexType>
      <xs:choice maxOccurs="unbounded">
        <xs:element ref="Panel"/>
        <xs:element ref="Label"/>
        <xs:element ref="Edit"/>   
        <xs:element ref="Combo"/>
        <xs:element ref="ComboBox"/>
        <xs:element ref="Button"/>
        <xs:element ref="ImageButton"/>
        <xs:element ref="AutoComplete"/>
        <xs:element ref="ListBox"></xs:element>
        <xs:element ref="DataTemplate"></xs:element>
        <xs:element ref="CheckBox"></xs:element>

      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="ComboBox">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="Component">
    
          <xs:sequence>
            <xs:element ref="Combo" minOccurs="0" maxOccurs="unbounded"/>        
          </xs:sequence>
          <xs:attribute name="dataTextField" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="dataValueField" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="selectedValue" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="selectedText" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="items" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="selectedIndex" type="xs:int" use="optional"></xs:attribute>
          <xs:attribute name="borderColor" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="OnSelectedIndexChanged" type="xs:string" use="optional"></xs:attribute>
        </xs:extension>  
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="AutoComplete">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="Component">
          <xs:attribute name="content" type="xs:string" use="optional">
            <xs:annotation>
              <xs:documentation>
                The content of the element. In most cases this is the text which
                should be displayed
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="serviceMethod" type="xs:string" use="required"></xs:attribute>
          <xs:attribute name="serviceAssemblyName" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="OnTextChanged" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="validRegularString" type="xs:string" use="optional"></xs:attribute>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="Combo">
    <xs:complexType>
      <xs:sequence>    
      </xs:sequence>   
       <xs:attribute name="value" type="xs:string"></xs:attribute>
      <xs:attribute name="content" type="xs:string"></xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="DataSource">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="ObjectDataProvider" maxOccurs="unbounded" minOccurs="0"></xs:element>
        <xs:element ref="XmlDataProvider" maxOccurs="unbounded" minOccurs="0"></xs:element>

      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="XmlDataProvider">
    <xs:complexType>
      <xs:sequence>
      </xs:sequence>
      <xs:attribute name="Source" type="xs:string"></xs:attribute>
      <xs:attribute name="Name" type="xs:string"></xs:attribute>
      <xs:attribute name="XPath" type="xs:string"></xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="ObjectDataProvider">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="ConstructorParameter" maxOccurs="1" minOccurs="0"></xs:element>
        <xs:element ref="MethodParameter" maxOccurs="1" minOccurs="0"></xs:element>
      </xs:sequence>
      <xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
      <xs:attribute name="type" type="xs:string" use="required"></xs:attribute>
      <xs:attribute name="methodName" type="xs:string" ></xs:attribute>

    </xs:complexType>
  </xs:element>
  <xs:element name="Parameter">
    <xs:complexType>
      <xs:sequence>
      </xs:sequence>
      <xs:attribute name="type" type="xs:string"></xs:attribute>
      <xs:attribute name="value" type="xs:string"></xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="MethodParameter">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="Parameter" maxOccurs="unbounded" ></xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ConstructorParameter">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="Parameter" maxOccurs="unbounded" ></xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Button">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="Component">
          <xs:attribute name="content" type="xs:string" use="optional">
            <xs:annotation>
              <xs:documentation>
                The content of the element. In most cases this is the text which
                should be displayed
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="pressedForeColor" type="xs:string"></xs:attribute>
          <xs:attribute name="pressedBackColor" type="xs:string"></xs:attribute>
          <xs:attribute name="Command" type="xs:string"></xs:attribute>
          <xs:attribute name="shadowColor" type="xs:string" use="optional"></xs:attribute>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="CheckBox">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="Component">
       
        
          <xs:attribute name="OnChecked" type="xs:string"></xs:attribute>
          <xs:attribute name="OnUnChecked" type="xs:string"></xs:attribute>
          <xs:attribute name="IfChecked" type="xs:boolean"></xs:attribute>

        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="ImageButton">
    <xs:annotation>
      <xs:documentation>
        A Button consisting of an image. The element content specifies the
        filename of the "default" image
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="Component">
          <xs:attribute name="icon" type="xs:string">
            <xs:annotation>
              <xs:documentation>The filename of the icon</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="pressed" type="xs:string">
            <xs:annotation>
              <xs:documentation>
                The filename of the image shown when the imagebutton
                is pressed
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="rollover" type="xs:string">
            <xs:annotation>
              <xs:documentation>
                The filename of the image which is shown when the
                mouse cursor is moved over the image but not
                pressed
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="disabled" type="xs:string">
            <xs:annotation>
              <xs:documentation>
                The filename of the image which is shown when the
                button is disabled
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="text" type="xs:string">
            <xs:annotation>
              <xs:documentation>
                The text to display in the image
                itself
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="antialias" type="xs:boolean">
            <xs:annotation>
              <xs:documentation>Should antialias be used here</xs:documentation>
            </xs:annotation>
          </xs:attribute>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="Edit">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="Component">
          <xs:attribute name="content" type="xs:string" use="optional">
            <xs:annotation>
              <xs:documentation>
                The content of the element. In most cases this is the text which
                should be displayed
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="OnTextChanged" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="validRegularString" type="xs:string" use="optional"></xs:attribute>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="ListBox">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="Component">
          <xs:attribute name="DataSource" type="xs:string" use="required"></xs:attribute>
          <xs:attribute name="ItemTemplate" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="ItemHeight" type="xs:int" use="optional"></xs:attribute>
          <xs:attribute name="PressedBackColor" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="PressedForeColor" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="BorderColor" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="SelectedBackColor" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="SelectedForeColor" type="xs:string" use="optional"></xs:attribute>

          <xs:attribute name="HoveredBackColor" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="HoveredForeColor" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="OnCommand" type="xs:string" use="optional"></xs:attribute>
          <xs:attribute name="OnDataSourceChanged" type="xs:string" use="optional"></xs:attribute>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="Panel">
    <xs:complexType>

      <xs:complexContent>
        <xs:extension base="Component">
          <xs:sequence>
            <xs:choice maxOccurs="unbounded">
              <xs:element ref="Panel"/>
              <xs:element ref="Label"/>
              <xs:element ref="Edit"/>
              <xs:element ref="Combo"/>
              <xs:element ref="ComboBox"/>
              <xs:element ref="Button"/>
              <xs:element ref="ImageButton"/>
              <xs:element ref="AutoComplete"/>
              <xs:element ref="ListBox"></xs:element>

            </xs:choice>
          </xs:sequence>
          <xs:attribute name="GradientFill" type="xs:boolean" use="optional">
            <xs:annotation>
              <xs:documentation>
               如果设置为True,那么使用绘制背景
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="GradientFillOffset" type="xs:int" use="optional">
            <xs:annotation>
              <xs:documentation>
                GradientFillOffset specifies the size of the gradient part until the solid background color part begin.
                ,If set to 0, the offset is the same as the height.
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
         
          <xs:attribute name="BackGroundImage" type="xs:string" use="optional">
            <xs:annotation>
              <xs:documentation>
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
        </xs:extension>
      </xs:complexContent>



    </xs:complexType>
  </xs:element>
  <xs:element name="XPage">
    <xs:complexType>
   
      <xs:complexContent>
        <xs:extension base="Component">
          <xs:sequence>

            <xs:element ref="Components" minOccurs="0"/>
            <xs:element ref="DataSource" minOccurs="0"></xs:element>
          </xs:sequence>
          <xs:attribute name="class" type="xs:string" use="optional"/>
          <xs:attribute name="prev" type="xs:string" use="optional"/>
          <xs:attribute name="next" type="xs:string" use="optional"/>
          <xs:attribute name="style" type="xs:string" use="optional"/>
          <xs:attribute name="name" type="xs:string" use="required"/>
        </xs:extension>
      </xs:complexContent>
 
      

    </xs:complexType>
  </xs:element>

  <xs:element name="DataTemplate">
    <xs:complexType>    
          <xs:sequence>
            <xs:choice maxOccurs="unbounded">
              <xs:element ref="Panel"/>
              <xs:element ref="Label"/>
              <xs:element ref="Edit"/>
              <xs:element ref="Combo"/>
              <xs:element ref="ComboBox"/>
              <xs:element ref="Button"/>
              <xs:element ref="AutoComplete"/>
              <xs:element ref="PictureBox"/>

            </xs:choice>
          </xs:sequence>
          <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>
  </xs:element>
</xs:schema>
